D2D (device-to-device) communication refers to allowing devices to directly communicate by multiplexing a real discovery resource pool under the control of a base station. The base station performs frequency division multiplexing and time division multiplexing on the real discovery resource pool to obtain m×n real discovery resources and further control a UE (user equipment) to send a discovery signal by using a corresponding real discovery resource. Time-frequency hopping is performed on a correspondence between the UE and the real discovery resources in the real discovery resource pool according to a particular rule. A time-frequency hopping solution of the real discovery resource pool may include a deterministic time-frequency hopping solution and a non-deterministic time-frequency hopping solution.
For the deterministic time-frequency hopping solution, for example, i(t)=i(0), j(t)=(j(0)+i(0)*t) % n, that is, a time-frequency location, in a two-dimensional array m×n, of a discovery signal sent by the UE in a tth frame is only exclusively determined by a time-frequency location, in the two-dimensional array m×n, of a discovery signal sent by the UE in a 0th frame and a frame identification code t of the current frame. If discovery signals sent by a transmit end and a receive end are in a same real discovery resource, and after time-frequency hopping is performed based on the deterministic time-frequency hopping solution, the discovery signals sent by the transmit end and the receive end are still in the same real discovery resource, the transmit end sends the discovery signal by using a target real discovery resource and receives, by using the target real discovery resource, the discovery signal sent by the receive end. In this case, strength of the discovery signal sent by the transmit end is much higher than that of the received discovery signal, and therefore, the transmit end can only send the discovery signal but cannot receive the discovery signal sent by the receive end. Similarly, the receive end that sends the discovery signal by using the target discovery resource can also only send the discovery signal but cannot receive the discovery signal sent by the transmit end.
For the non-deterministic time-frequency hopping solution, for example, a random time-frequency hopping solution, a receive end cannot determine time-frequency locations, in a matrix m×n, of discovery signals sent by a transmit end in different frames, and therefore cannot combine the discovery signals sent by the transmit end in different frames to acquire a signal having a greatest signal-to-noise ratio, where the signal having the greatest signal-to-noise ratio is the discovery signal sent by the transmit end.